package com.jx.driving.transmission;

import java.util.Arrays;

import com.jx.driving.message.TimeTerminalTransmissionMessage;
import com.jx.driving.protocol.terminal.annotation.ByteAnnotation;
import com.jx.driving.protocol.terminal.annotation.DynamicByteArrayAnnotation;
import com.jx.driving.protocol.terminal.annotation.LimitedStringAnnotation;
import com.jx.driving.protocol.terminal.annotation.TerminalAnnotation;

/**
 * 教练员登录应答
 * 
 * @author shenliuyang
 *
 *         2016年8月14日下午4:43:33
 */
@TerminalAnnotation
public class Terminal0x8101Transmission extends TimeTerminalTransmissionMessage {
    @ByteAnnotation(order = 1)
    private short result;// 登录结果1：登录成功；2：无效的教练员编号；3：准教车型不符；9：其他错误
    @LimitedStringAnnotation(value = 16, order = 2)
    private String coachNo;// 教练编号
    @ByteAnnotation(order = 3)
    private short attachementable;// 是否附加消息
    @DynamicByteArrayAnnotation(value = 1, order = 4)
    private byte[] attachement;// 附加消息

    public short getResult() {
	return result;
    }

    public void setResult(short result) {
	this.result = result;
    }

    public String getCoachNo() {
	return coachNo;
    }

    public void setCoachNo(String coachNo) {
	this.coachNo = coachNo;
    }

    public short getAttachementable() {
	return attachementable;
    }

    public void setAttachementable(short attachementable) {
	this.attachementable = attachementable;
    }

    public byte[] getAttachement() {
	return attachement;
    }

    public void setAttachement(byte[] attachement) {
	this.attachement = attachement;
    }

    @Override
    public String toString() {
	StringBuilder builder = new StringBuilder();
	builder.append("Terminal0x8101Response [result=").append(result).append(", coachNo=").append(coachNo)
		.append(", attachementable=").append(attachementable).append(", attachement=")
		.append(Arrays.toString(attachement)).append("]");
	return builder.toString();
    }

}
